package Objects;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;

public class AllSprite {
	public Sprite m_grass1;
	public Sprite m_ground1;
	public Sprite m_background1;
	public Sprite m_rock1;
	public Sprite m_monster1;
	public Sprite m_monster2;
	public Sprite m_monster3;
	public Sprite m_monsterDestroy;
	public Sprite m_fire1;
	
	public Sprite m_background2;
	public Sprite m_rockm2;
	public Sprite m_grass1m2;
	public Sprite m_grass2m2;
	public Sprite m_groundm2;
	public Sprite m_trap;
	public Sprite m_cloud;
	public Sprite m_end;
	public Sprite m_life;
	public Sprite m_save;
	/*
	 CSprite* m_grass1;
	CSprite* m_ground1;
	CSprite* m_background1;
	CSprite* m_rock1;
	CSprite* m_monster1;
	CSprite* m_monster2;
	CSprite* m_monster3;
	CSprite* m_monsterDestroy;
	CSprite* m_fire1;
	
	CSprite* m_background2;
	CSprite* m_rockm2;
	CSprite* m_grass1m2;
	CSprite* m_grass2m2;
	CSprite* m_groundm2;
	CSprite* m_trap;
	CSprite* m_cloud;
	CSprite* m_end;
	CSprite* m_life;
	 */
	
	private static AllSprite instance = null;
	
	public static AllSprite getInstance() {
		if(instance == null) {
			instance = new AllSprite();
		}
		return instance;
	}
	
	public AllSprite() {
		// TODO Auto-generated constructor stub
		// Grass 1
		initSprite(m_grass1, "Images/UNIT/grass.png");
		// ground 1
		initSprite(m_ground1, "Images/UNIT/BreakBrick.png");
		// background 1
		initSprite(m_background1, "Images/UNIT/Background1.png");
		// background 2
		initSprite(m_background2, "Images/UNIT/Background2.png");
		// Rock1
		initSprite(m_rock1, "Images/UNIT/ROCK.png");
		// RockM2
		initSprite(m_rockm2, "Images/UNIT/RockM2.png");
		// m_grass1m2
		initSprite(m_grass1m2, "Images/UNIT/Grass2M2.png");
		// m_grass2m2
		initSprite(m_grass2m2, "Images/UNIT/Grass3M2.png");
		// Cloud
		initSprite(m_cloud, "Images/UNIT/cloud.png");
		// ground m2
		initSprite(m_groundm2, "Images/UNIT/GroundM2.png");
		// Trap
		initSprite(m_trap, "Images/UNIT/TrapM2.png");
		// Life
		initSprite(m_life, "Images/Heal.png");
		// Save
		initSprite(m_save, "Images/UNIT/Save.png");
	}
	
	private void initSprite(Sprite sprite, String fileName) {
		Texture myTexture = new Texture(Gdx.files.internal(fileName));
		myTexture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
		sprite = new Sprite(myTexture);
		myTexture.dispose();
	}
	
	
}
